package com.mineplatform.mapper;

import java.util.ArrayList;
import java.util.List;


import com.mineplatform.domain.M_Province;

import com.mineplatform.dto.rep.ProvinceItemRep;
import com.mineplatform.dto.rep.ProvinceListRep;


public class ProvinceMapper {

	public static ProvinceListRep parse(List<M_Province> list) {

		ProvinceListRep rep = new ProvinceListRep();
		List<ProvinceItemRep> dtoList = new ArrayList<ProvinceItemRep>();
		for (M_Province p : list) {
			ProvinceItemRep dto = new ProvinceItemRep();
			
			dto.setId(p.getId());
			dto.setCode(p.getProvinceCode());
			dto.setName(p.getProvinceName());
			
			dtoList.add(dto);
		}
		rep.setProvinces(dtoList);
		return rep;
	}
}
